package org.mspring.platform.task;

import java.util.Map;

import org.springframework.scheduling.annotation.Async;

/**
 * @author Gao Youbo
 * @since Feb 20, 2012
 */
public abstract class AbstractTask implements Task {

    @Async
    @Override
    public void doAsyncTask(final Map<Object, Object> context) throws Exception {
        AbstractTask.this.doTask(context);
    }

    @Override
    public void doSyncTask(Map<Object, Object> context) throws Exception {
        doTask(context);
    }

    protected abstract void doTask(Map<Object, Object> paramMap) throws Exception;
}
